<?php 
	require_once("class.DBConn.php");
	$obj=new DBConn();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="author" content="izwebz" />
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript" charset="utf-8" src="js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/dropdown.js"></script>
	<title>Drop down menu</title>
</head>

<body>
    <div id="wrapper">
    <?php $queryParent=$obj->LoadMenuParent();?>
    <ul>
       <?php
    while($pr = mysqli_fetch_assoc($queryParent))
    {
    ?>
          <li>
             <a target="<?php echo ($pr['newPageMenu'] == "1") ? "_blank" : "_self"; ?>" title="<?php echo $pr['titleMenu']; ?>" href="<?php echo $pr['linkMenu']; ?>"> <?php echo $pr['nameMenu']; ?></a>
          </li>
       <?php
          $queryChild = mysql_query("SELECT idMenu,nameMenu,linkMenu,titleMenu,newPageMenu FROM menu 
                        WHERE isPublished = '1' and isParent = '0' and parentId = '".$pr['idMenu']."' order by 'order' ASC ");
        if(mysqli_num_rows($queryChild) != 0)
    {
        echo "<ul>";
            while($ch = mysqli_fetch_assoc($queryChild))
            {
    ?>
               <li>
        <a target="<?php echo ($ch['newPageMenu'] == "1") ? "_blank" : "_self"; ?>" 
                               title="<?php echo $ch['titleMenu']; ?>" href="<?php echo $ch['linkMenu']; ?>"><?php echo $ch['nameMenu']; ?></a>
               </li>
    <?php
        }
           echo "</ul>";
    }
     }
?>
     </ul>
    </div>

</body>
</html>